The use and the popularity of computer systems have steadily increased since around the middle of the twentieth century. While this trend has been fueled by many different advances in computer system technology, the fact remains that many of the components that are found in today's computer systems were present in even some of the earliest systems. Two of these computer system components are the computer system's processor and its memory.
As is well known, information (called data) is stored in a the computer system's memory. This memory is generally categorized into two types. While there are various names used to characterize these two basic types of computer system memory, the terms used in this patent are "main memory" and "auxiliary storage." In general, main memory is used by the computer system to store information that is of current interest to the programs executing on the computer system's processor. Auxiliary storage, on the other hand, is used to store the information that is not currently needed by the programs.
Auxiliary storage devices, which are sometimes referred to as mass storage devices, generally have much greater storage capability than that of main memory. However, the time it takes to access the information is generally much longer than that of main memory. This is why computer systems move needed information from the larger/slower mass storage devices into the smaller/faster main memory before operating on the information. As one can imagine, though, main memory is much more expensive than auxiliary storage. The difference in expense is so significant that computer system designers are constantly struggling with the problem of reducing the need for main memory. This problem is particularly acute in small imbedded systems, where the margin between cost and market price is especially slim. Another situation where main memory space is at a premium is the case of devices that do not include auxiliary storage (e.g., medialess personal computers and network stations).
While there are a variety of avenues that can be taken to reduce the amount of main memory that is needed in a computer system, one intuitive approach is to reduce each computer program's need for main memory. Broadly speaking, computer programs use main memory in two ways. First, since programs must be loaded into main memory to execute, the very size of a computer system's individual programs will to some degree dictate the amount of main memory that is needed. Second, programs need main memory space while they are executing. While this need for main memory applies to a variety of main memory constructs, this patent pertains to a main memory construct that is referred to as automatic storage or stack space.
The stack (i.e., the physical entity that is said to take up the stack space) is used to store status information about executing programs so that programs can call one another. When one program calls another program, status information about the calling program is stored on the stack so that the calling program can resume its processing after the called program returns control of the processor to the calling program. Amongst other pieces of information, this status information will often include what are referred to as automatic variables. Automatic variables are used during execution of a program and are stored on the stack so that the calling program can have access to them after the program resumes its processing.
The problem with the way automatic variables are handled in existing computer systems is that every automatic variable is stored on the stack, regardless of whether each and every variable is needed when the calling program resumes execution. From the above discussion it can be readily seen that the "store everything" approach of prior art mechanisms is extremely wasteful in a world where main memory space is at such a premium.
Without a mechanism that can more efficiently handle automatic variable storage, expensive main memory will continue to be wasted by prior art mechanisms.